package top.superxuqc.loginbili.service;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import top.superxuqc.loginbili.util.MyHttpClient;

import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.Map;

@Service
public class SearchAudioService {
    private MyHttpClient httpClient = new MyHttpClient();


    public JSONObject getMusic(String keyword,int page,HttpServletRequest request){


        String result = httpClient.getMusic(request, "http://api.bilibili.com/x/web-interface/search/type", keyword,page);
        JSONObject videoInfo = JSONObject.parseObject(result).getJSONObject("data");




        return videoInfo;

    }
}
